package com.aaa.controller;

import com.aaa.entity.Goods;
import com.aaa.entity.ResponseMsg;
import com.aaa.service.GoodsService;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("goods")
public class GoodsController<ResponseMsg> {

    @Resource
    GoodsService goodsService;

    @RequestMapping("select")
    public PageInfo<Goods> select(Integer pageNum,Integer pageSize){
        return goodsService.select(pageNum,pageSize);
    }
    @RequestMapping("insert")
    public com.aaa.entity.ResponseMsg addGoods(Goods goods){
        return new com.aaa.entity.ResponseMsg(200,"修改成功",goodsService.addGoods(goods));
    }
    @RequestMapping("update")
    public com.aaa.entity.ResponseMsg upGoods(Goods goods){
        return new com.aaa.entity.ResponseMsg(200,"修改成功",goodsService.upGoods(goods));
    }
}
